<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>资源分类 - 1024导航</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        accent: '#F59E0B',
                        dark: '#1F2937',
                        light: '#F9FAFB'
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .card-hover {
                @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-1;
            }
            .category-active {
                @apply bg-primary text-white border-primary;
            }
            .text-gradient {
                @apply bg-clip-text text-transparent bg-gradient-to-r from-primary to-secondary;
            }
        }
    </style>
</head>

<body class="bg-gray-50 font-sans text-gray-800">
    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex justify-between items-center">
            <div class="flex items-center space-x-2">
                <div class="text-primary text-2xl font-bold">1024<span class="text-secondary">导航</span></div>
                <span class="hidden md:inline-block text-sm text-gray-500 bg-gray-100 px-2 py-1 rounded">v2.3</span>
            </div>

            <nav class="hidden md:flex items-center space-x-6">
                <a href="index.html" class="text-gray-600 hover:text-primary transition-colors">首页</a>
                <a href="#" class="text-primary font-medium">资源</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">工具</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">社区</a>
                <a href="#" class="text-gray-600 hover:text-primary transition-colors">关于</a>
            </nav>

            <div class="flex items-center space-x-3">
                <button
                    class="hidden md:block px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">
                    <i class="fa fa-user-plus mr-1"></i> 登录
                </button>
                <button class="md:hidden text-gray-600 text-xl">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 搜索区域 - 已更新为参考风格 -->
    <section class="py-10 bg-gradient-to-b from-white to-gray-50 border-b border-gray-100">
        <div class="container mx-auto px-4">
            <div class="max-w-3xl mx-auto text-center">
                <h1 class="text-[clamp(1.8rem,5vw,2.5rem)] font-bold mb-4 text-gradient">探索优质资源</h1>
                <p class="text-gray-600 mb-8">从开发工具到学习资料，一站式获取各类实用资源</p>

                <div class="relative">
                    <input type="text" placeholder="搜索资源、工具或教程..."
                        class="w-full px-5 py-4 rounded-lg shadow-md border border-gray-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all">
                    <button
                        class="absolute right-2 top-2 bottom-2 px-5 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors">
                        <i class="fa fa-search mr-1"></i> 搜索
                    </button>
                </div>

                <div class="mt-4 flex flex-wrap justify-center gap-2 text-sm">
                    <span class="text-gray-500">热门搜索:</span>
                    <a href="#" class="text-gray-600 hover:text-primary">AI工具</a>
                    <a href="#" class="text-gray-600 hover:text-primary">设计资源</a>
                    <a href="#" class="text-gray-600 hover:text-primary">编程学习</a>
                    <a href="#" class="text-gray-600 hover:text-primary">影视网站</a>
                    <a href="#" class="text-gray-600 hover:text-primary">PPT模板</a>
                </div>
            </div>
        </div>
    </section>

    <!-- 资源内容区 -->
    <section class="py-10">
        <div class="container mx-auto px-4">
            <div class="max-w-5xl mx-auto flex flex-col lg:flex-row gap-6">
                <!-- 左侧分类菜单 -->
                <div class="lg:w-1/4">
                    <div class="bg-white rounded-xl shadow-sm p-5 sticky top-24">
                        <h3 class="font-semibold text-lg mb-4 pb-2 border-b border-gray-100">资源分类</h3>

                        <ul class="space-y-1">
                            <li>
                                <button
                                    class="category-active w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between">
                                    <span><i class="fa fa-th-large mr-2"></i> 全部资源</span>
                                    <span class="bg-white text-primary text-xs px-2 py-0.5 rounded-full">128</span>
                                </button>
                            </li>
                            <li>
                                <button
                                    class="w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between hover:bg-gray-50">
                                    <span><i class="fa fa-code mr-2"></i> 开发工具</span>
                                    <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">32</span>
                                </button>
                            </li>
                            <li>
                                <button
                                    class="w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between hover:bg-gray-50">
                                    <span><i class="fa fa-paint-brush mr-2"></i> 设计资源</span>
                                    <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">24</span>
                                </button>
                            </li>
                            <li>
                                <button
                                    class="w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between hover:bg-gray-50">
                                    <span><i class="fa fa-graduation-cap mr-2"></i> 学习教育</span>
                                    <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">41</span>
                                </button>
                            </li>
                            <li>
                                <button
                                    class="w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between hover:bg-gray-50">
                                    <span><i class="fa fa-film mr-2"></i> 影音娱乐</span>
                                    <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">18</span>
                                </button>
                            </li>
                            <li>
                                <button
                                    class="w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between hover:bg-gray-50">
                                    <span><i class="fa fa-shopping-cart mr-2"></i> 电商购物</span>
                                    <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">15</span>
                                </button>
                            </li>
                            <li>
                                <button
                                    class="w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between hover:bg-gray-50">
                                    <span><i class="fa fa-image mr-2"></i> 图片素材</span>
                                    <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">27</span>
                                </button>
                            </li>
                            <li>
                                <button
                                    class="w-full text-left px-3 py-2 rounded-md transition-colors flex items-center justify-between hover:bg-gray-50">
                                    <span><i class="fa fa-mobile mr-2"></i> 移动应用</span>
                                    <span class="bg-gray-100 text-gray-600 text-xs px-2 py-0.5 rounded-full">12</span>
                                </button>
                            </li>
                        </ul>

                        <div class="mt-6 pt-4 border-t border-gray-100">
                            <h4 class="font-medium mb-3">热门标签</h4>
                            <div class="flex flex-wrap gap-2">
                                <a href="#"
                                    class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-full transition-colors">#AI工具</a>
                                <a href="#"
                                    class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-full transition-colors">#免费资源</a>
                                <a href="#"
                                    class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-full transition-colors">#编程学习</a>
                                <a href="#"
                                    class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-full transition-colors">#高清壁纸</a>
                                <a href="#"
                                    class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-full transition-colors">#PPT模板</a>
                                <a href="#"
                                    class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-full transition-colors">#电子书</a>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 右侧资源列表 -->
                <div class="lg:w-3/4">
                    <!-- 排序和筛选 -->
                    <div
                        class="bg-white rounded-xl shadow-sm p-4 mb-6 flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
                        <div class="flex items-center space-x-2">
                            <span class="text-gray-600">排序方式:</span>
                            <select
                                class="border border-gray-200 rounded-md px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-primary">
                                <option>推荐资源</option>
                                <option>最新收录</option>
                                <option>访问最多</option>
                                <option>评分最高</option>
                            </select>
                        </div>

                        <div class="flex items-center space-x-3">
                            <button
                                class="p-2 bg-primary/10 text-primary rounded-md hover:bg-primary/20 transition-colors">
                                <i class="fa fa-th-large"></i>
                            </button>
                            <button
                                class="p-2 bg-gray-100 text-gray-600 rounded-md hover:bg-gray-200 transition-colors">
                                <i class="fa fa-list"></i>
                            </button>
                        </div>
                    </div>

                    <!-- 资源列表 - 开发工具 -->
                    <div class="mb-8">
                        <div class="flex items-center mb-4">
                            <div
                                class="w-8 h-8 rounded-lg bg-blue-100 flex items-center justify-center text-primary mr-2">
                                <i class="fa fa-code"></i>
                            </div>
                            <h2 class="text-lg font-semibold">开发工具</h2>
                        </div>

                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                            <!-- 资源卡片1 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-blue-100 flex items-center justify-center text-primary mr-3 flex-shrink-0">
                                        <i class="fa fa-code"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">在线代码编辑器</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">
                                            无需安装，在线编写和运行多种编程语言代码，支持实时预览和分享</p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 12.5k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.8</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- 资源卡片2 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-purple-100 flex items-center justify-center text-purple-600 mr-3 flex-shrink-0">
                                        <i class="fa fa-database"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">数据库在线工具</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">
                                            在线数据库设计、SQL执行和数据可视化工具，支持多种数据库类型</p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 8.3k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.6</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- 资源卡片3 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-green-100 flex items-center justify-center text-green-600 mr-3 flex-shrink-0">
                                        <i class="fa fa-sitemap"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">API接口管理平台</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">
                                            API设计、测试、文档生成一体化平台，支持团队协作和版本控制</p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 6.7k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.7</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- 资源卡片4 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-amber-100 flex items-center justify-center text-amber-600 mr-3 flex-shrink-0">
                                        <i class="fa fa-search"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">代码搜索工具</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">跨平台代码搜索和分析工具，支持语法高亮和代码片段分享
                                        </p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 5.2k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.5</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="mt-4 text-center">
                            <a href="#" class="text-primary hover:underline text-sm inline-flex items-center">
                                查看更多开发工具 <i class="fa fa-angle-right ml-1"></i>
                            </a>
                        </div>
                    </div>

                    <!-- 资源列表 - 设计资源 -->
                    <div class="mb-8">
                        <div class="flex items-center mb-4">
                            <div
                                class="w-8 h-8 rounded-lg bg-purple-100 flex items-center justify-center text-purple-600 mr-2">
                                <i class="fa fa-paint-brush"></i>
                            </div>
                            <h2 class="text-lg font-semibold">设计资源</h2>
                        </div>

                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                            <!-- 资源卡片1 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-purple-100 flex items-center justify-center text-purple-600 mr-3 flex-shrink-0">
                                        <i class="fa fa-desktop"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">UI设计模板库</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">
                                            高质量UI设计模板，包含移动端和桌面端，支持Figma、Sketch和XD</p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 9.8k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.9</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- 资源卡片2 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-indigo-100 flex items-center justify-center text-indigo-600 mr-3 flex-shrink-0">
                                        <i class="fa fa-font"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">免费字体库</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">
                                            精选可商用免费字体，包含中文字体和英文字体，支持多种格式下载</p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 7.6k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.7</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="mt-4 text-center">
                            <a href="#" class="text-primary hover:underline text-sm inline-flex items-center">
                                查看更多设计资源 <i class="fa fa-angle-right ml-1"></i>
                            </a>
                        </div>
                    </div>

                    <!-- 资源列表 - 学习教育 -->
                    <div class="mb-8">
                        <div class="flex items-center mb-4">
                            <div
                                class="w-8 h-8 rounded-lg bg-amber-100 flex items-center justify-center text-amber-600 mr-2">
                                <i class="fa fa-graduation-cap"></i>
                            </div>
                            <h2 class="text-lg font-semibold">学习教育</h2>
                        </div>

                        <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                            <!-- 资源卡片1 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-blue-100 flex items-center justify-center text-primary mr-3 flex-shrink-0">
                                        <i class="fa fa-book"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">编程电子书库</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">
                                            免费编程电子书资源，涵盖Python、Java、JavaScript等多种编程语言</p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 15.2k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.8</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <!-- 资源卡片2 -->
                            <div class="bg-white rounded-xl shadow-sm p-4 card-hover">
                                <div class="flex items-start">
                                    <div
                                        class="w-10 h-10 rounded bg-green-100 flex items-center justify-center text-green-600 mr-3 flex-shrink-0">
                                        <i class="fa fa-video-camera"></i>
                                    </div>
                                    <div class="flex-1 min-w-0">
                                        <h3 class="font-medium text-gray-800 mb-1 truncate">免费教程视频</h3>
                                        <p class="text-gray-500 text-sm mb-2 line-clamp-2">高质量免费教程视频，包含编程、设计、办公软件等各类技能学习
                                        </p>
                                        <div class="flex justify-between items-center">
                                            <div class="flex items-center text-xs text-gray-400">
                                                <span class="mr-3"><i class="fa fa-eye mr-1"></i> 21.7k</span>
                                                <span><i class="fa fa-star text-yellow-400 mr-1"></i> 4.9</span>
                                            </div>
                                            <a href="#" class="text-primary text-sm hover:underline">访问</a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="mt-4 text-center">
                            <a href="#" class="text-primary hover:underline text-sm inline-flex items-center">
                                查看更多学习资源 <i class="fa fa-angle-right ml-1"></i>
                            </a>
                        </div>
                    </div>

                    <!-- 加载更多 -->
                    <div class="text-center mt-8">
                        <button
                            class="px-6 py-2.5 bg-white border border-gray-200 rounded-md text-gray-700 hover:bg-gray-50 transition-colors inline-flex items-center">
                            <i class="fa fa-refresh mr-2"></i> 加载更多资源
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 底部区域 -->
    <footer class="bg-gray-800 text-gray-300 py-10 mt-10">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-white text-lg font-semibold mb-4">1024导航</h3>
                    <p class="text-sm text-gray-400 mb-4">精选互联网优质资源，打造高效便捷的导航平台，助力你的工作与学习。</p>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-github text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-twitter text-xl"></i>
                        </a>
                        <a href="#" class="text-gray-400 hover:text-white transition-colors">
                            <i class="fa fa-weixin text-xl"></i>
                        </a>
                    </div>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">快速链接</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="index.html" class="text-gray-400 hover:text-white transition-colors">首页</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">资源分类</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">实用工具</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">最新收录</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">热门推荐</a></li>
                    </ul>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">帮助支持</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用指南</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">资源提交</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">常见问题</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">联系我们</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">举报不良信息</a></li>
                    </ul>
                </div>

                <div>
                    <h3 class="text-white font-medium mb-4">关于我们</h3>
                    <ul class="space-y-2 text-sm">
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">网站介绍</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">隐私政策</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">使用条款</a></li>
                        <li><a href="#" class="text-gray-400 hover:text-white transition-colors">免责声明</a></li>
                    </ul>
                </div>
            </div>

            <div class="border-t border-gray-700 mt-8 pt-6 text-center text-sm text-gray-500">
                <p>© 2023 1024导航. 本站资源仅供学习交流使用，如有侵权请联系删除。</p>
            </div>
        </div>
    </footer>

    <!-- 回到顶部按钮 -->
    <button id="backToTop"
        class="fixed bottom-6 right-6 w-12 h-12 rounded-full bg-primary text-white shadow-lg flex items-center justify-center opacity-0 invisible transition-all duration-300">
        <i class="fa fa-arrow-up"></i>
    </button>

    <script>
        // 回到顶部按钮功能
        const backToTopBtn = document.getElementById('backToTop');

        window.addEventListener('scroll', () => {
            if (window.scrollY > 300) {
                backToTopBtn.classList.remove('opacity-0', 'invisible');
                backToTopBtn.classList.add('opacity-100', 'visible');
            } else {
                backToTopBtn.classList.remove('opacity-100', 'visible');
                backToTopBtn.classList.add('opacity-0', 'invisible');
            }

            // 导航栏滚动效果
            const header = document.querySelector('header');
            if (window.scrollY > 50) {
                header.classList.add('py-2', 'shadow');
                header.classList.remove('py-3', 'shadow-sm');
            } else {
                header.classList.add('py-3', 'shadow-sm');
                header.classList.remove('py-2', 'shadow');
            }
        });

        backToTopBtn.addEventListener('click', () => {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });

        // 分类切换功能
        const categoryButtons = document.querySelectorAll('ul.space-y-1 button');
        categoryButtons.forEach(button => {
            button.addEventListener('click', () => {
                // 移除所有按钮的活跃状态
                categoryButtons.forEach(btn => {
                    btn.classList.remove('category-active');
                    btn.classList.add('hover:bg-gray-50');
                });

                // 为当前点击的按钮添加活跃状态
                button.classList.add('category-active');
                button.classList.remove('hover:bg-gray-50');

                // 在实际应用中，这里会根据选择的分类加载相应的资源
                const categoryName = button.querySelector('span').textContent.trim();
                console.log(`切换到分类: ${categoryName}`);
            });
        });

        // 搜索功能
        const searchInput = document.querySelector('input[placeholder="搜索资源、工具或教程..."]');
        const searchButton = document.querySelector('button:has(.fa-search)');

        function handleSearch() {
            const query = searchInput.value.trim();
            if (query) {
                alert(`搜索资源: ${query}\n在实际应用中，这里会显示搜索结果`);
            } else {
                alert('请输入搜索内容');
            }
        }

        searchButton.addEventListener('click', handleSearch);
        searchInput.addEventListener('keypress', (e) => {
            if (e.key === 'Enter') {
                handleSearch();
            }
        });

        // 加载更多功能
        const loadMoreBtn = document.querySelector('button:has(.fa-refresh)');
        loadMoreBtn.addEventListener('click', () => {
            loadMoreBtn.innerHTML = '<i class="fa fa-spinner fa-spin mr-2"></i> 加载中...';

            // 模拟加载延迟
            setTimeout(() => {
                loadMoreBtn.innerHTML = '<i class="fa fa-refresh mr-2"></i> 加载更多资源';
                alert('已加载全部资源');
            }, 1500);
        });
    </script>
</body>

</html>